//
//  UserLikeTableViewCell.m
//  one·一个  tyw
//
//  Created by tyw on 15/9/15.
//  Copyright (c) 2015年 tyw. All rights reserved.
//

#import "UserLikeTableViewCell.h"
#import "DayNightLabel.h"

@implementation UserLikeTableViewCell {
    DayNightLabel* titleLabel;
    DayNightLabel* dateLabel;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        titleLabel = [[DayNightLabel alloc] initWithFrame:CGRectMake(20, 5, kWidth-140, self.bounds.size.height-10)];
        [titleLabel loadLabelColor];
        titleLabel.textAlignment = NSTextAlignmentLeft;
        titleLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:titleLabel];
//        titleLabel.backgroundColor = [UIColor redColor];
        
        dateLabel = [[DayNightLabel alloc] initWithFrame:CGRectMake(kWidth-130, 5, 100, self.bounds.size.height-10)];
        [dateLabel loadLabelColor];
        dateLabel.textAlignment = NSTextAlignmentRight;
        dateLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:dateLabel];
//        dateLabel.backgroundColor = [UIColor greenColor];
        
        
    }
    
    return self;
}


- (void)setDataDic:(NSDictionary *)dataDic {
    _dataDic = dataDic;
    
    [self setNeedsLayout];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    NSString* title = _dataDic[@"strT"];
    [titleLabel loadLabelColor];
    titleLabel.text = title;
    
    NSString* date = _dataDic[@"strD"];
    [dateLabel loadLabelColor];
    dateLabel.text = date;
}

@end
